package com.zpark.controller;

import com.zpark.common.R;
import com.zpark.entity.Menu;
import com.zpark.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/menu")
public class MenuController {

    @Autowired
    private MenuService menuService;

    @GetMapping("/queryAllMenus")
    public R queryAllMenus(){
        List<Menu> menus = menuService.queryAllMenus();
        return R.ok().put("data",menus);
    }

}
